package com.zr.datamodel;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 * 车辆实体类
 * @author qiuchun
 *
 */
@Entity
@Table(name="ld_van")
public class VanDM {
	private int id;
	//车型
	private String carType;
	//司机
	private UserDM user;
	//车辆状态
	private int carStatus;
	private List<OrderDM> orders=new ArrayList<>();
	@Id
	@GeneratedValue
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	@Column(name="car_type")
	public String getCarType() {
		return carType;
	}
	public void setCarType(String carType) {
		this.carType = carType;
	}
	@OneToOne
	public UserDM getUser() {
		return user;
	}
	public void setUser(UserDM user) {
		this.user = user;
	}
	@Column(name="car_status")
	public int getCarStatus() {
		return carStatus;
	}
	public void setCarStatus(int carStatus) {
		this.carStatus = carStatus;
	}
	@OneToMany(mappedBy="van")
	public List<OrderDM> getOrders() {
		return orders;
	}
	public void setOrders(List<OrderDM> orders) {
		this.orders = orders;
	}
}
